package com.easwift.qsp.enums;

/**
 * 传感器类型枚举
 * 
 * @author Administrator
 *
 */
public enum SensorTypeEnum {

	ACCELERATE(1, "加速度计"),

	LEAN_ANGLE(2, "倾角仪"),

	WIND_PRESSURE(3, "风压传感器"),

	EARTHQUAKE(4, "地震仪"),

	SUPER_WIND_SPEED(5, "超声风速"),

	SUPER_WIND_DIRECTION(6, "超声风向"),

	WIND_ANGLE(7, "风仰角"),

	TEMPERATURE(8, "温度"),

	MACHINE_WIND_SPEED(9, "机械风速"),

	MACHINE_WIND_DIRECTION(10, "机械风向"),

	DISTANCE(11, "位移计");

	private int code;

	private String name;

	private SensorTypeEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	public static String getNameByCode(int code) {
		for (SensorTypeEnum type : SensorTypeEnum.values()) {
			if (type.getCode() == code) {
				return type.getName();
			}
		}
		return null;
	}

}